Skip to content

feat: Add a JSON Block definition interface#9613

Open
heliacer wants to merge 1 commit intoRaspberryPiFoundation:mainfrom
heliacer:main
Open

feat: Add a JSON Block definition interface#9613
heliacer wants to merge 1 commit intoRaspberryPiFoundation:mainfrom
heliacer:main

Conversation

@heliacer
Copy link
Copy Markdown

@heliacer heliacer commented Mar 5, 2026

This is a follow-up of #9402 :D (please read)

Changes:

  • Add custom field/input support as requested by @maribethb
  • Add tests in tests/typescript for field mitosis

The custom fields are done by augmenting, as shown in the jsdoc example.
Also I'm not too proud of the documentation strings in general but I'm leaving it as-is now.

lmk if I need to change something in order to merge :>

Copilot AI review requested due to automatic review settings March 5, 2026 18:59
@heliacer heliacer requested a review from a team as a code owner March 5, 2026 18:59
@heliacer heliacer requested a review from gonfunko March 5, 2026 18:59
@github-actions github-actions bot added the PR: feature Adds a feature label Mar 5, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@gonfunko gonfunko requested a review from maribethb March 12, 2026 15:32
@gonfunko gonfunko removed their request for review March 12, 2026 15:33
@gonfunko gonfunko removed their assignment Mar 12, 2026
@heliacer
Copy link
Copy Markdown
Author

hi, I noticed the review assignment changed,
@maribethb pinging in case you have time to review this.
thanks :D

Copy link
Copy Markdown
Contributor

@maribethb maribethb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your patience while we reviewed this. This needed some consultation from our resident TS expert and after chatting with him I think we want to go in a different direction for custom fields for now. But the rest of this is mostly solid, thank you for your work on it.

@heliacer heliacer force-pushed the main branch 3 times, most recently from 16361e8 to def8672 Compare March 28, 2026 11:13
@heliacer
Copy link
Copy Markdown
Author

hi @maribethb,
I've made the changes you requested.

for the custom fields (and inputs), I provided an UnknownArg which looks like this

interface UnknownArg {
  type: string
  [key: string]: unknown
}

this preserves existing typings, so intellisense continues to work as expected.
If you'd start typing "pr" it would suggest you previousStatement and so on. I personally think that this change is really helpful, since it doesn't require you to always rely on the block factory if you already know how the basic json block definition looks like.

Thanks :D & Have a good day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature Adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants